package com.fyzk.adapter;

import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import com.fyzk.bean.DocumentaryMenuResponse;

import java.util.List;

/**
 * @author yangfeng
 * @create 2018/10/11 13:36
 * @Describe 方案详情的ViewPager的adapter
 */
public class BluePrintDetailsAdapter extends FragmentStatePagerAdapter {
    private List<DocumentaryMenuResponse> mData;
    private List<Fragment> mTabFragment;

    public BluePrintDetailsAdapter(FragmentManager fm, List<DocumentaryMenuResponse> data, List<Fragment> mTabFragment) {
        super(fm);
        this.mData = data;
        this.mTabFragment = mTabFragment;
    }

    @Override
    public Fragment getItem(int i) {
        return mTabFragment.get(i);
    }

    @Override
    public int getCount() {
        return mData.size();
    }

    @Nullable
    @Override
    public CharSequence getPageTitle(int position) {
        return mData.get(position).getName();
    }
}
